<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" Inherits="Sueetie.Core.SueetieBasePage" %>

<%@ Import Namespace="Sueetie.Core" %>

<script runat="server">
    public void Page_Error(object sender, System.EventArgs e)
    {
        Exception x = Server.GetLastError();
        YAF.Classes.Data.DB.eventlog_create(forum.PageUserID, this, x);
        YAF.Classes.Utils.CreateMail.CreateLogEmail(x);
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        MembershipUser user = Membership.GetUser();
       
        AdminLink.NavigateUrl = "/admin/default.aspx";
        ForumAdminLink.NavigateUrl = "default.aspx?g=admin_admin";
        ForumModerateLink.NavigateUrl = "default.aspx?g=moderate_index";

        if (!Page.User.IsInRole("SueetieAdministrator"))
        {
            AdminLI.Visible = false;
            AdminLink.Visible = false;
        }
        if (!Page.User.IsInRole("ForumAdministrator"))
        {
            ForumAdminLI.Visible = false;
            ForumAdminLink.Visible = false;
            ForumModerateLink.Visible = false;
            ForumModerateLI.Visible = false;
        }
        UserLink.Text = "Welcome, Guest!";
        UserLink.NavigateUrl = "/members/login.aspx";
        if (Page.User.Identity.IsAuthenticated)
        {
            UserLink.Text = "Welcome, " + CurrentSueetieUser.Profile.DisplayName + "!";
            UserLink.NavigateUrl = "/members/myaccountinfo.aspx";
        }
        if (Page.User.Identity.IsAuthenticated)
            RegisterLI.Visible = false;
        if (CurrentSueetieUser.HasAvatarImage)
        {
            AvatarLink.ImageUrl = "/images/avatars/" + CurrentUserID.ToString() + "t.jpg?d=" + DateTime.Now.ToLongTimeString();
            AvatarLink.NavigateUrl = "/members/myaccountinfo.aspx?iv=1";
        }
        else
            AvatarLink.ImageUrl = "/images/avatars/noavatarthumbnail.jpg";
    }
    
</script>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="YafHead" runat="server">
    <link href="/style/shared.css" rel="stylesheet" type="text/css" />
    <!--[if IE]>
	         <link href="/style/ie.css" rel="stylesheet" type="text/css" />
          <![endif]-->
    <meta name="Description" content="A bulletin board system written in ASP.NET" />
    <meta name="Keywords" content="Yet Another Forum.net, Forum, ASP.NET, BB, Bulletin Board, opensource" />
    <title>This title is overwritten</title>
</head>
<body>
    <form id="form1" runat="server" enctype="multipart/form-data">
    <div class="banner">
        <div class="topmenus">
            <div class="headerrightlinks">
                <ul class="menu">
                    <li><a href="/wiki/Setup.ashx">Getting Started</a></li>
                    <li><a href="/blog">Blog</a></li>
                    <li class="current"><a href="/forum">Forums</a></li>
                    <li><a href="/media">Media</a></li>
                    <li><a href="/wiki">Wiki</a></li>
                    <li><a href="/groups">Groups</a></li>
                    <li><a href="/blog/contact.aspx">Contact Us</a></li>
                </ul>
            </div>
   <div class="headerrightbottomlinks">
          <ul class="menu">
              
                <li>
                    <asp:LoginStatus ID="LoginStatus1" runat="Server" LoginText="Sign in" LogoutText="Sign out"
                        EnableViewState="false" />
                </li>
                <li runat="server" id="RegisterLI">
                    <asp:HyperLink ID="RegisterLink" runat="server" Text="Register" NavigateUrl="/members/register.aspx" /></li>
                <li runat="server" id="AdminLI">
                    <asp:HyperLink ID="AdminLink" runat="server" Text="Control Panel" /></li>
                <li runat="server" id="ForumAdminLI">
                    <asp:HyperLink ID="ForumAdminLink" runat="server" Text="Forum Admin" /></li>
                <li runat="server" id="ForumModerateLI">
                    <asp:HyperLink ID="ForumModerateLink" runat="server" Text="Moderate" /></li>
                 <li runat="server" id="UserLI">
                    <asp:HyperLink ID="UserLink" runat="server" /></li>      
                        <li class="spacer" />
                    <li class="AvatarHeader"><asp:HyperLink ID="AvatarLink" runat="server" /></li>
                             
            </ul>
   
      </div>            
        </div>
        <div id="TopLeftLogo">
            <a href="/default.aspx">&nbsp;</a></div>
        <div class="headerleftbottomlinks">
          </div>
    </div>
    <div id="bannershadow">
    </div>
    <div id="ContainerDivOuter">
        <div id="ContainerDiv">
            <div id="sidepanel">
                <h4>
                    About Sueetie Forums</h4>
                <p>
                    Sueetie Forums are powered by YetAnotherForum.NET, an Open Source application lead
                    by Jaben Cargman.</p>
                <p>
                    YetAnotherForum.NET is available under the <a title="Go to the GNU General Public License home page"
                        href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License.</a></p>
                <div style="height: 15px;">
                </div>
                <h4>
                    Sueetie Forum Links</h4>
                <ul>
                    <li><a href="default.aspx">Forums Home Page</a></li>
                    <li><a href="default.aspx?g=active">Active Topics</a></li>
                    <li><a href="default.aspx?g=search">Search the Forums</a></li>
                    <li><a href="default.aspx?g=members">Member Activity</a></li>
                    <li><a href="default.aspx?g=cp_profile">Your Forums Profile</a></li>
                    <li><a href="default.aspx?g=topics&f=1">The Sandbox</a></li>
                </ul>
                <div class="sidelogoarea">
                    <a href="http://yetanotherforum.net">
                        <img src="images/yafsmall.jpg" border="0" /></a>
                </div>
            </div>
            <div id="forumbody">
                <div id="PageLinksArea">
                    <a href="default.aspx">Sueetie Forums</a>
                </div>
                <YAF:Forum runat="server" ID="forum" />
            </div>
        </div>
        <div id="footer">
            <div id="sueetietag">
                <a href="http://sueetie.org">
                    <img src="../images/footerlogo.gif" border="0" /></a>
            </div>
        </div>
    </div>
    </form>
    
    <script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-1080415-3");
pageTracker._trackPageview();
} catch(err) {}</script>

</body>
</html>
